package com.dzf.entity;

/**
 * 返回封装对象
 */
public class RespJson {

    private int code;

    private String msg;

    private Object Data;


    public RespJson(){

    }

    public RespJson(int code, String msg, Object data) {

        this.code = code;
        this.msg = msg;
        Data = data;
    }

    public static RespJson success(int code,String msg,Object data){
        return new RespJson(code,msg,data);

    }

    public  static RespJson success(String msg,Object data){

        return new RespJson(200,msg,data);

    }

    public  static RespJson success(String msg){

        return new RespJson(200,msg,null);

    }


    public static RespJson error(String msg){

        return new RespJson(400,msg,null);

    }

    public static RespJson error(int code,String msg){

        return new RespJson(code,msg,null);

    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return Data;
    }

    public void setData(Object data) {
        Data = data;
    }
}
